var t = "", e = getApp(), a = 2 * e.globalData.statusBarHeight + 20;

Page({
    data: {
        statusBarHeight: a,
        plugin_point_name: ""
    },
    onLoad: function(t) {
        t.plugin_point_name && this.setData({
            plugin_point_name: t.plugin_point_name
        }), t.allNum && this.setData({
            allNum: t.allNum
        }), t.tag && this.setData({
            tag: t.tag
        }), t.questionnaire_id && this.setData({
            questionnaire_id: t.questionnaire_id
        }), t.score && this.setData({
            score: t.score
        }), t.cons && this.setData({
            cons: t.cons
        }), t.goods_id && this.setData({
            goods_id: t.goods_id
        }), t.rewardPoint && this.setData({
            rewardPoint: t.rewardPoint
        }), this.getData();
    },
    backone: function(t) {
        wx.navigateBack({
            delta: 1
        });
    },
    back: function(t) {
        var e = getCurrentPages(), a = e[e.length - 3];
        a.setData({
            questionnaire_is_open: !1,
            is_open: "close"
        }), wx.setStorageSync("closeOpen", "close"), wx.navigateBack({
            delta: 2
        }), console.log(a);
    },
    continue: function() {
        wx.navigateTo({
            url: "/packageE/questionnaire/questionnaireIndex/questionnaireIndex"
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var t = this, a = e.getNetAddresss("plugin.questionnaire.api.index.indexInfo");
        e._getNetWork({
            url: a,
            data: {
                getAnswerScore: "getAnswerScore",
                score: this.data.score,
                questionnaire_id: this.data.questionnaire_id
            },
            success: function(e) {
                var a = e.data;
                console.log(a), 1 == a.result ? t.setData({
                    info: a.data.getAnswerScore.recommendation
                }) : wx.showToast({
                    icon: "none",
                    title: a.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    onReady: function() {
        var e = this, a = 10;
        e.data.systemWidth <= 360 ? a = 14 : e.data.systemWidth >= 430 && (a = 18), function(t, e, a, n) {
            wx.createSelectorQuery().select(e).boundingClientRect(function(t) {
                if (null != t || null != t) {
                    a > 100 && (a = 100);
                    var i = t.width / 2, o = t.height / 2;
                    e = e.split(".")[1];
                    var s = wx.createCanvasContext(e);
                    s.beginPath(), s.lineWidth = n, s.strokeStyle = "#eee", s.lineCap = "round", s.shadowOffsetX = 0, 
                    s.shadowOffsetY = 0, s.shadowBlur = 15, s.shadowColor = "#7bbfff", s.arc(i, o, i - n / 2 - 5, .75 * Math.PI, 2.25 * Math.PI, !1), 
                    s.translate(0, 0), s.stroke(), s.draw();
                }
            }).exec();
        }(0, ".cirWeek_gray", 100, a), setTimeout(function() {
            !function(e, a, n, i) {
                wx.createSelectorQuery().select(a).boundingClientRect(function(e) {
                    if (null != e || null != e) {
                        var o = e.width / 2, s = e.height / 2;
                        a = a.split(".")[1];
                        var r = wx.createCanvasContext(a);
                        if ("cirWeek_run" == a) {
                            var c = 0;
                            clearInterval(t), t = setInterval(function() {
                                c >= n && (clearInterval(t), c = n), c++, r.beginPath(), r.setLineWidth(i), r.setLineCap("round"), 
                                r.setStrokeStyle("#ffdf70"), r.arc(o, s, o - i / 2 - 5, .75 * Math.PI, (.75 + c / 100 * 1.5) * Math.PI), 
                                r.translate(0, 0), r.stroke(), r.draw(), r.closePath();
                            }, 18);
                        }
                    }
                }).exec();
            }(0, ".cirWeek_run", parseInt(e.data.score / e.data.allNum * 100), a);
        }, 500);
    }
});